package com.dmm.vod.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dmm.vod.entity.Video;
import com.dmm.vod.mapper.VideoMapper;
import com.dmm.vod.service.VideoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 课程视频 服务实现类
 * </p>
 *
 * @author dmm
 * @since 2022-09-07
 */
@Service
public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements VideoService {

    @Autowired
    VideoMapper videoMapper;
    //根据课程id删除小节
    @Override
    public void removeVideoByCourseId(Long id) {

        QueryWrapper<Video> queryWrapper=new QueryWrapper<>();
        queryWrapper.eq("course_id",id);
        videoMapper.delete(queryWrapper);
    }
}
